QuickTime 3 Reference

| Previous | Chapter contents | Chapter top | Section top | Next |

Preparing the Sample Description

Next, a sample description is prepared. This is identical to the sample description that would be prepared if the same effect was added to a QuickTime movie. The code in Listing 20-8 creates a sample description that selects Apple's SMPTE Wipe ( `smpt' ) effect.

Listing 8 Preparing a Sample Description

{
    ImageDescriptionHandlemySampleDesc = NULL;

    // create a new, empty sample description
    mySampleDesc = (ImageDescriptionHandle)NewHandleClear(sizeof(ImageDescription));

    // fill in the fields of the sample description
    (**mySampleDesc).idSize     = sizeof(ImageDescription);
    (**mySampleDesc).cType      = `smpt';
    (**mySampleDesc).vendor     = kAppleManufacturer;
    (**mySampleDesc).temporalQuality = codecNormalQuality;
    (**mySampleDesc).spatialQuality = codecNormalQuality;
    (**mySampleDesc).width      = theWidth;
    (**mySampleDesc).height     = theHeight;
    (**mySampleDesc).hRes       = 72L << 16;
    (**mySampleDesc).vRes       = 72L << 16;
    (**mySampleDesc).frameCount = 1;
    (**mySampleDesc).depth      = 0;
    (**mySampleDesc).clutID     = -1;

    return(mySampleDesc);
}

© 1997 Apple Computer, Inc.

| Previous | Chapter contents | Chapter top | Section top | Next |